﻿<!DOCTYPE html>
<html lang="en">
<#include "../include/resource-head.ftl"/>
<body>
<#include "../include/common-top.ftl"/>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
    <#include "../include/common-menu.ftl"/>
        <div class="main-content">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-search">
                            <form role="form" class="form-inline clearfix"  id="form2"  action="">
                                <div class="input-group col-xs-2">
                                    <span class="input-group-addon">年份</span>
                                    <select name="year" class="form-control">
                                        <option value="2018" <#if year! = '2018'></#if>>2018</option>
                                        <option value="2017" <#if year! = '2017'></#if>>2017</option>
                                        <option value="2016" <#if year! = '2016'></#if>>2016</option>
                                        <option value="2015" <#if year! = '2015'></#if>>2015</option>
                                        <option value="2014" <#if year! = '2014'></#if>>2014</option>
                                        <option value="2013" <#if year! = '2013'></#if>>2013</option>
                                        <option value="2012" <#if year! = '2012'></#if>>2012</option>
                                        <option value="2011" <#if year! = '2011'></#if>>2011</option>
                                        <option value="2010" <#if year! = '2010'></#if>>2010</option>
                                        <option value="2009" <#if year! = '2009'></#if>>2009</option>
                                    </select>
                                </div>


                            </form>
                            <div class="form-tool btn-group">
                                <button class="btn btn-sm btn-success" form="form2">
                                    <i class="icon-search"></i>搜索
                                </button>

                                <#--<button class="btn btn-sm btn-primary" onclick="location.href='/doc/add'">
                                    <i class="icon-plus"></i>添加
                                </button>-->
                            </div>
                        </div>
                        <div class="table-responsive">
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>文档名</th>
                                    <td>文档编号</td>
                                    <th>分类名</th>
                                    <th>备注</th>
                                    <th>添加时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <#list pageInfo.list as item>
                                <tr>
                                    <td>${item.name!}</td>
                                    <td>${item.no!}</td>
                                    <td>${item.categoryname!}</td>
                                    <td>${item.descript!}</td>
                                    <td>${item.addtime?string('yyyy-MM-dd HH:mm:ss')}</td>
                                    <td>
                                        <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                                            <a class="btn btn-xs btn-primary" href="/order/add/${item.id}">申请修改</a>
                                            <a class="btn btn-xs btn-info" href="${item.path}">下载</a>
                                            <a class="btn btn-xs btn-info" onclick="upload('${item.id}')">上传</a>
                                        </div>
                                    </td>
                                </tr>
                                </#list>
                                </tbody>
                            </table>
                        <#include "../include/table-page.ftl"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>


<div id="upload" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">上传文档</h4>
            </div>
            <div class="modal-body">
                <form  name="form1" id="form1" class="form-horizontal" method="post" action="/doc/update" enctype="multipart/form-data">
                    <input type="hidden" name="id" id="docID">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">文档</label>
                        <div class="col-sm-10">
                            <input type="file" required class="form-control" name="file">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="submit" form="form1" class="btn btn-primary">上传</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<#include "../include/resource-script.ftl"/>
<script>
    function upload(id) {
        $("#docID").val(id);
        $("#upload").modal("show");
    }
</script>
</html>

